;(function(global) {
  global.subject = {
    template: `
              <div class="subject-container">
                <div v-if="examItemData.typeid === 1">
                  <div class="subject-type-top">
                    <zl-radio :where="where" ref="radio" :exam-item-data="examItemData" :index="index" @answerToSheet="answerToSheet"></zl-radio>
                  </div>
                </div>
                <div v-if="examItemData.typeid === 2">
                  <div class="subject-type-top">
                    <zl-checkbox :where="where " ref="checkbox" :exam-item-data="examItemData" :index="index" @answerToSheet="answerToSheet"></zl-checkbox>
                  </div>
                </div>
                <div v-if="examItemData.typeid === 4">
                  <div class="subject-type-top">
                    <zl-field :where="where" ref="field" :exam-item-data="examItemData" :index="index" @answerToSheet="answerToSheet"></zl-field>
                  </div>
                </div>
              </div>
          `,
    props: ['where', 'examItemData', 'index'],
    components: {
      'zl-radio': radio,
      'zl-checkbox': checkbox,
      'zl-field': field
    },
    data() {
      return {}
    },
    computed: {},
    methods: {
      // 将选择结果给答题卡
      answerToSheet(obj) {
        this.$emit('answer-to-sheet', obj)
      }
    },
    created() {},
    mounted() {}
  }
})(window)
